import {
  getLocation
} from "@/common/js/utils"

// 获取导航菜单
const locationObj = {
  likeLocation: getLocation()
}
export const getMenuList = (param) => window.ajaxBase.request('/v1/enhance/pub/menu/business/listByUser', 'post', Object.assign(param, locationObj), {
  enterpriseid: localStorage.getItem('userEnterpriseid'),
  showLoading: true
})

export const allProjectList = (params) => window.ajaxBase.request(`/v1/basic/project/project/list`, 'post', params, {
  showLoading: true
})

//项目列表
export const queryAuthProjects = () => window.ajaxBase.request('/v1/business/space/auth/project/list')

// 项目列表
export const projectList = (params) => window.ajaxBase.request(`/v1/business/project/getProjectList`, 'post', params, {
  showLoading: true
})

// 切换项目列表select请求
export const seletedProject = (params) => window.ajaxBase.request(`/v1/business/project/selectedProject`, 'post', params, {
  showLoading: true
})

export const uploadPhoto = (params) => window.ajaxBase.uploadParam(`/v1/frameworks/photos/upload`, params, {
  showLoading: true
});

//审核
export const apiDoAudit = (param) => window.ajaxBase.request(`/v1/rent/process/business/approval`, 'post', param, {
  showLoading: true
});
//详情  
export const detailByTaskId = (param) => window.ajaxBase.request(`/v1/rent/process/business/detailByTaskId`, 'get', param, {
  showLoading: true
});

//流程意见
export const apiFlowOption = (param) => window.ajaxBase.request(`/v1/rent/process/business/getMessage`, 'post', param, {
  showLoading: true
});

//常量-计划
export const apiConstant = (params) => window.ajaxFinancialplan.request(`/v1/constant`, 'get', '', {
  showLoading: true
});

//常量-合同
export const apiPactConstant = (params) => window.ajaxBusinessContract.request(`/v1/constant`, 'get', '', {
  showLoading: true
});

//单点
export const apiPointLogin = (ticket) => window.ajaxbusinessAssets.request(`/v1/user/single/point/${ticket}`, 'post', {}, {
  showLoading: true
});

//内部单点
export const apiInnerPointLogin = (originToken) => window.ajaxbusinessAssets.request(`/v1/user/single/inner/point/${originToken}`, 'post', {}, {
  showLoading: true
});

// 事件更新列表
export const workInfoList = (param) => window.ajaxbusinessAssets.request(`/v1/business/work/info/list`, 'post', param, {
  showLoading: false
});
// 待办审批的数量
export const todoList = (param) => window.ajaxbusinessAssets.request(`/v1/business/todo/list`, 'post', param, {
  showLoading: false
});

// 数量
export const countUnReadNum = (param) => window.ajaxbusinessAssets.request(`/v1/business/work/info/countUnReadNum`, 'post', param, {
  showLoading: false
});

// 累计现金流入\支出
export const cashFlowChargeItem = (params) => window.ajaxFinancialplan.request(`/v1/business/cashflow/chargeItem`, 'post', params, {
  showLoading: true
});

// 财务表现详情
export const performanceFinancialDetail = (params) => window.ajaxFinancialplan.request(`/v1/business/performance/financial/item`, 'post', params, {
  showLoading: true
});

// 经营活动现金流量(集团运营首页)
export const apiOperationIncomeCash = (params) => window.ajaxFinancialplan.request(`/v1/business/indicator/operationIncomeCash`, 'post', params, {
  showLoading: true
});

//创建日志
export const apiOperationLogCreate = (params) => window.ajaxbusinessAssets.request(`/v1/basic/commercialrent/operationlog/operation/log/create`, 'post', params, {
  showLoading: false
});

//操作日志
export const apiOperationLog = (param) => window.ajaxbusinessAssets.request('/v1/basic/commercialrent/operationlog/operation/log/list', 'post', param, {
  showLoading: true
});

//异常日志
export const apiErrLog = (param) => window.ajaxbusinessAssets.request('/v1/basic/commercialrent/exceptionlog/log/list', 'post', param, {
  showLoading: true
});

//提审
export const apiCreateAudit = (param) => window.ajaxBusinessContract.request(`/v1/contract/process/business/createRuOrder`, 'post', param, {
  showLoading: true
});